package com.hb.trans.di

import android.app.Application
import com.basiclib.network.RxErrorHandler
import com.ctcnit.templatepro.di.ActivitiesModule
import com.ctcnit.templatepro.di.FragmentsModule
import com.hb.trans.api.EndPoints
import com.hb.trans.global.HbApplication
import dagger.BindsInstance
import dagger.Component
import dagger.android.support.AndroidSupportInjectionModule
import javax.inject.Singleton


@Singleton
@Component(
    modules = arrayOf(
        AppModules::class,
        ActivitiesModule::class,
        FragmentsModule::class,
        AndroidSupportInjectionModule::class
    )
)
interface AppComponent {
    fun inject(application: HbApplication)
    fun endpoints(): EndPoints
    fun rxErrorHandler(): RxErrorHandler
    @Component.Builder
    interface Builder {
        @BindsInstance
        fun application(application: Application): Builder

        fun build(): AppComponent
    }
}

